const nodemailer = require('nodemailer');
//引入证书文件
const credentails = require('../config/credentails')
//创建传输方式
const transporter = nodemailer.createTransport({
    service: 'qq',
    auth: {
        user: credentails.qq.user,
        pass: credentails.qq.pass
    }
})

//注册发送邮件给用户
exports.emailSignUp = (email, res) => {


    let options = {
        from: '1273648987@qq.com',
        to: email.mail,
        subject: '孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿孤儿',
        html: '<span>欢迎您的加入!</span><a href="http://localhost:8080/">点击</a>'
    }
    console.log(options, '11122');

    transporter.sendMail(options, (err, msg) => {
        if (err) {
            console.log(err);

        } else {
            res.send('邮件发送成功')


        }
    })



}

